#ifndef APPLICATION_H
#define APPLICATION_H

#include "Window.h"
#include "Event.h"
#include "ApplicationEvent.h"

#include "Timeticker.h"
#include "ImGuiLayer.h"
#include "Shader.h"
#include "Buffer.h"
#include "VertexArray.h"
#include "OrthoCamera.h"
#include <glm/glm.hpp>
#include "Texture.h"
#include "LayerStack.h"
namespace HS {

	class Application {
	public:
		Application(const std::string& name = "Render Engine",int width = 1000, int height = 800);
		virtual ~Application();
		void PushLayer(Layer* layer);
		void PushOverlay(Layer* layer);
		void OnEvent(Event& e);
		void Run();
		void Close();
		Window& GetWindow() { return *m_Window; }
		static Application& Get() { return *s_Instance; }
		ImGuiLayer* GetImGuiLayer() { return m_ImGuiLayer; }
	private:
		bool OnWindowClose(WindowCloseEvent& e);
		bool OnWindowResize(WindowResizeEvent& e);
		bool OnKeyPressedEvent(KeyPressedEvent& e);
	private:
		std::unique_ptr<Window> m_Window;
		ImGuiLayer* m_ImGuiLayer;
	    LayerStack m_LayerStack;

		bool m_Running = true;
		bool m_Minimized = false;
		float m_LastFrameTime = 0.0f;
		float m_CameraSpeed = 1.0f;
		glm::vec3 m_CamPos = glm::vec3(0.0f);
		Timestep timestep;
		static Application* s_Instance;
	};


}

#endif //
